<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>插槽(slot)</title>
</head>
<body>
    <div id="app">
        <cpn>
            <button>按钮</button>
        </cpn>
        <cpn>
            <p>ppppp</p>
        </cpn>
        <cpn>
            <span>嘻嘻嘻</span>
        </cpn>
        <cpn></cpn>
    </div>

    <template id="cpn">
        <div>
            <h2>我是cpn</h2>
            <h2>我是哈哈哈</h2>
            <!-- 
                插槽的使用:
                    1.基本使用:<slot></slot>
                    2.默认值:<slot><button></button></slot>
             -->
            <slot>
                <button>默认按钮</button>
            </slot>
        </div>
    </template>

    <script src="../vue/vue.js"></script>
    <script>
        const cpn = {
            template:'#cpn',
            data() {
                return {
                    
                }
            },
            methods:{

            }
        }
        const app = new Vue({
            el:'#app',
            data:{

            },
            methods: {
                
            },
            components:{
                cpn
            }
        });
    </script>
</body>
</html>